//
//  MCRechargeFooterView.m
//  TLYL
//
//  Created by MC on 2017/6/13.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCRechargeFooterView.h"
@interface MCRechargeFooterView ()
@property (nonatomic,strong)UIButton * btn_recharge;
@end

@implementation MCRechargeFooterView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createUI];
    }
    return self;
}

-(void)createUI{
    
    self.backgroundColor=[UIColor whiteColor];
    //充值
    _btn_recharge=[[UIButton alloc]init];
    [_btn_recharge setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_btn_recharge setTitle:@"确认充值" forState:UIControlStateNormal];
    [_btn_recharge setBackgroundColor:[UIColor cyanColor]];
    [self addSubview:_btn_recharge];
    [self.btn_recharge addTarget:self action:@selector(action_Recharge) forControlEvents:UIControlEventTouchUpInside];
    
    [self layOutConstraints];
    
}

/*
 * 点击确认充值
 */
-(void)action_Recharge{
    
    if ([self.delegate respondsToSelector:@selector(MCRechargeFooter_Recharge)]) {
        [self.delegate MCRechargeFooter_Recharge];
    }
    
}

-(void)layOutConstraints{
    
    [_btn_recharge mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(40);
        make.right.equalTo(self.mas_right).offset(-40);
        make.top.equalTo(self.mas_top).offset(50);
        make.bottom.equalTo(self.mas_bottom);
    }];
    
}

+(CGFloat)computeHeight:(id)info{
    return 100;
}

@end

























